package com.pyrsana.faith.membership

class UserFilters {

    def springSecurityService
    
    def filters = {
        all(controller:'*', action:'*') {
            before = {

            }
            after = { Map model ->
                if (model && springSecurityService.isLoggedIn()) {
                    model.user = User.get(springSecurityService.principal.id)
                    if (log.isDebugEnabled()) {
                        log.debug("User: " + model['user'])
                    }
                }
            }
            afterView = { Exception e ->

            }
        }
    }
}
